package com.stox.services.screener.screen.gainer;

import com.stox.services.screener.model.AbstractScreenMatch;
import com.stox.shared.beans.annotation.Property;

public class GainerScreenMatch extends AbstractScreenMatch {

	private final double initialPrice;
	private final double finalPrice;
	private final double gain;
	private final double gainPercentage;
	
	public GainerScreenMatch(Long scripId, double initialPrice, double finalPrice) {
		super(scripId);
		this.initialPrice = initialPrice;
		this.finalPrice = finalPrice;
		this.gain = finalPrice - initialPrice;
		this.gainPercentage = gain*100/initialPrice;
	}
	
	@Property(index=0)
	public double getInitialPrice() {
		return initialPrice;
	}
	
	@Property(index=1)
	public double getFinalPrice() {
		return finalPrice;
	}
	
	@Property(index=2)
	public double getGain() {
		return gain;
	}
	
	@Property(index=3, displayNameKey="gainPercent")
	public double getGainPercentage() {
		return gainPercentage;
	}

}
